﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using BTN04.BUS;

namespace BTN04.USER
{
    public partial class chitietsanpham : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["idSanPham"] == null)
                {
                    Response.Redirect("trangchu.aspx");
                }
                else
                {
                    string _maSanPham = Request.QueryString["idSanPham"];
                    SanPhamBUS spBUS = new SanPhamBUS();
                    DataTable dt = new DataTable();
                    dt = spBUS.LaySanPhamTheoMa(_maSanPham);
                    DataRow dr = dt.Rows[0];
                    imgChiTiet.ImageUrl = "~/" + dr["HinhAnh"];
                    lblGiaBan.Text = dr["GiaBan"].ToString();
                    lblTenSanPham.Text = dr["TenSanPham"].ToString();
                    lblSoLuongXem.Text = dr["SoLuongXem"].ToString();
                    lblNhaSanXuat.Text = dr["TenNhaSanXuat"].ToString();
                    lblSoLuongTon.Text = dr["SoLuongTon"].ToString();
                    lblXuatXu.Text = dr["TenXuatSu"].ToString();
                    lblMoTa.Text = dr["MoTa"].ToString();
                }
            }
        }

        protected void txtMuaNgay_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
